﻿<?xml version="1.0" encoding="utf-8" ?>
<ViewModelMapping xmlns="urn:mvmmapper:mappingfile">
  <ViewModelClass name="Persons"
                  namespace="PersonLookup.ViewModel"
                  commandClass="MVVM.ActionCommand">
    <Properties>

      <Property name="Collection"
                type="PersonLookup.ViewModel.PersonCollection"/>

      <Property name="NewPerson"
                type="PersonLookup.ViewModel.Person"/>
    </Properties>

    <Commands>
      <Command name="AddPersonCommand"/>
    </Commands>
    
  </ViewModelClass>
  <ViewModelProviderClass name="PersonsProvider"
                          namespace="PersonLookup.ViewModel.Providers">
    <Methods>
      <Method name="GetAll" generateCommand="true">
        <Result name="persons"
                type="PersonLookup.ViewModel.PersonCollection"
                isViewModel="true"/>
        <WrappedMethod name="GetPersonsAsync"
                       providerName="PersonServiceClient"
                       providerNamespace="PersonLookup.PersonServiceReference">
          <Result>
            <Asynchronous methodCompletedEventName="GetPersonsCompleted"
                          eventArgsType="PersonLookup.PersonServiceReference.GetPersonsCompletedEventArgs"/>
          </Result>
        </WrappedMethod>
      </Method>
    </Methods>
  </ViewModelProviderClass>
</ViewModelMapping>